# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-m2crypto
_pkgname=M2Crypto
pkgver=0.38.0
pkgrel=1
pkgdesc='A Python crypto and SSL toolkit.'
url='https://pypi.org/project/M2Crypto/#files'
arch=('x86_64' 'aarch64')
license=('BSD')
depends=('python2' 'python2-typing' 'openssl')
makedepends=('python2-setuptools' 'swig')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b1e24e3101ce0dd9f17be4cabeddc2ec0f1228b270d74ef2fb38bae8807c5025b031d0743185f06370786a3dd5c3f42129720534dcff07ea4de3c727613f8d20')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

